home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / virus / vc2dm10.lha / vc2dm.rexx < prev   
OS/2 REXX Batch file  |  1993-03-08  |  2KB  |  47 lines

  1. /*rx*/
  2. /* vc2dm.rexx    1.0 */
  3. /* Script for checking files for viruses from Disk Master II */
  4.  
  5. OPTIONS RESULTS
  6.  
  7. parse arg DMpath                /*put path/filename into variable DMpath */
  8. address 'Virus_Checker'         /*connect with VC's ARexx port */
  9. 'checkfile\' || DMpath          /*VC ARexx command plus our path/filename */
  10. VCsez= result                   /*put VC's return value into var VCsez */
  11. 'address' DM                    /*connect with Disk Master's ARexx port */
  12. if VCsez= 'RESULT' then         /*If VC has returned no bad news */
  13.                                 
  14. /*If a var has nothing put into it, it just contains its own name. */
  15.  
  16.     say 'File OK'               /*Print message 'OK' to DM title bar */
  17. else do
  18.     address DM 'ScrBack'        /*DMII command pushes it's screen back */
  19.     call open('STDERR','CON:0/0/500/90/Virus Checker') /*open a window for output*/
  20.     call writeln( 'STDERR', '')
  21.     call writeln( 'STDERR', '>>>> ALERT <<<<')
  22.     call writeln( 'STDERR', '')
  23.     call writeln( 'STDERR', VCsez parsfil(DMpath) || '.')   
  24.     
  25.     /*Send VC message to window along with filename as processed by parsfil()*/
  26.     
  27.     call writeln( 'STDERR', '')
  28.     call writeln( 'STDERR', 'Repair is automatic if file disk not write protected.')
  29.     call writeln( 'STDERR', '')
  30.     call writeln( 'STDERR', 'PRESS RETURN TO CONTINUE')
  31.     parse external waitcall     /*bad programming. Makes window wait for CR */
  32.     address DM 'ScrBack'        /*DMII command pushes it's screen back */
  33.     /*DM is having some problems with the previous command. Apologies */
  34.     end
  35. exit                            /*bye bye */
  36.     
  37. parsfil:
  38. /* This subroutine takes a full path name and hands back just the filename */
  39.  
  40. parse arg DMpath dev ":" rest   /*chop anything before a colon */
  41.  
  42. do while rest ~= ""             /*keep chopping as long as there are slashes */
  43.     parse var rest bit "/" rest
  44.     end
  45.  
  46. return bit                      /*Should be the filename if input wasn't too wierd */
  47.